<?php

use Lg\View\Asset;
?>
<?php echo get_header(); ?>
<div class="row">
    <div class="col-lg-12">

        <form class="form-horizontal" action="" method="post">
            
            <ul class="nav nav-tabs" role="tablist">
                    <li class="nav-item"><a class="nav-link active" href="#general" data-toggle="tab">常规设置</a></li>
                    <li class="nav-item"><a class="nav-link" href="#mailsettings" data-toggle="tab">邮件设置</a></li>

                   
                </ul>
          
            <div class="tab-content">
                <div class="tab-pane active" id="general">
                    <div class="form-group row">
                        <label for="system.sitename" class="col-sm-2 control-label">网站名称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="system.sitename" name="system[sitename]" value="<?php echo $options['system']['sitename']; ?>" placeholder="请输入网站名称">
                        </div>
                    </div>   


                    <div class="form-group row">
                        <label for="system.language" class="col-sm-2 control-label">网站语言</label>
                        <div class="col-sm-10">
                            <select class="form-control"  id="system.language" name="system[language]">
                                <?php foreach ($languages as $lang) { ?>
                                    <option value="<?php echo $lang->directory; ?>" <?php echo $options['system']['language'] == $lang->directory ? ' selected ' : ''; ?> >
                                        <?php echo $lang->name; ?>
                                    </option>
                                <?php } ?>

                            </select>
                        </div>
                    </div>
                    <div class="form-group  row">
                        <label for="system.language" class="col-sm-2 control-label">后端默认语言</label>
                        <div class="col-sm-10">
                            <select class="form-control"  id="system.admin_language" name="system[admin_language]">
                                <?php foreach ($languages as $lang) { ?>
                                    <option value="<?php echo $lang->directory; ?>" <?php echo $options['system']['admin_language'] == $lang->directory ? ' selected ' : ''; ?> >
                                    <?php echo $lang->name; ?>
                                    </option>
                                <?php } ?>
                            </select>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="site.icp_number" class="col-sm-2 control-label">ICP备案号</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="system.icp_number" name="site[icp_number]" value="<?php echo $options['site']['icp_number']; ?>" placeholder="ICP备案号">
                        </div>
                    </div>

                    <div class="form-group row">
                        <label for="site.maintenance" class="col-sm-2 control-label">维护模式</label>
                        <div class="col-sm-10">
                            <label class="label-checkbox" for="site.maintenance">                                    
                                <input type="checkbox" id="site.maintenance" name="site[maintenance]" value="1" <?php
                                echo value_condition($options['site']['maintenance'], 'checked');
                                ?>  />
                                关闭网站
                            </label>
                            <textarea class="form-control" rows="3" name="site[maintenance_info]" placeholder="系统维护中,请稍后访问 ..."><?php echo $options['site']['maintenance_info']; ?></textarea>
                        </div>

                    </div>

                </div>
                <!-- /.tab-pane -->                       
                <div class="tab-pane" id="mailsettings">
                    <div class="form-group row">
                            <label for="mail.protocol" class="col-sm-2 control-label">发送协议</label>
                            <div class="col-sm-10">
                                <select class="form-control"  id="mail.protocol" name="mail[protocol]">
                                    <option value="mail" <?php echo $options['mail']['protocol'] == 'mail' ? 'selected' : ''; ?>   >Mail</option>
                                    <option value="smtp" <?php echo $options['mail']['protocol'] == 'smtp' ? 'selected' : ''; ?> >SMTP</option>
                                </select>
                            </div>
                        </div>                                
                        <div class="form-group row">
                            <label for="mail.hostname" class="col-sm-2 control-label">SMTP 主机名</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="mail.hostname" name="mail[hostname]" value="<?php echo $options['mail']['hostname']; ?>" placeholder="SMTP主机名">
                            </div>
                        </div>

                        <div class="form-group row">
                            <label for="mail.username" class="col-sm-2 control-label">用户名</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="mail.username" name="mail[username]"  value="<?php echo $options['mail']['username']; ?>" placeholder="SMTP用户名" >
                            </div>
                        </div>                                
                        <div class="form-group row">
                            <label for="mail.password" class="col-sm-2 control-label">密码</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="mail.password" name="mail[password]"  value="<?php echo $options['mail']['password']; ?>"  placeholder="SMTP密码" >
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="mail.port" class="col-sm-2 control-label">SMTP 端口</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="mail.port" name="mail[port]"  value="<?php echo get_default($options['mail']['port'], 25); ?>"  placeholder="SMTP端口 默认25">
                            </div>
                        </div> 
                        <div class="form-group row">
                            <label for="mail.timeout" class="col-sm-2 control-label">SMTP Timeout</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="mail.timeout" name="mail[timeout]"  value="<?php
                                echo get_default($options['mail']['timeout'], 10);
                                ?>" >
                            </div>
                        </div>
                   
                </div>
                <!-- /.tab-pane -->
                <div class="card-footer clearfix">
                    <button type="submit" class="btn btn-success pull-right">保存设置</button>
                </div>  
            </div>
            <!-- /.tab-content -->

        </form>
    </div><!-- col-12 -->
</div>
<br/>
<?php echo get_footer(); ?>
